package com.ay.weixin.mail.domain;

import javax.mail.internet.AddressException;

import org.lizar.controller.loader.EventLoader;
import org.lizar.ioc.Cell;
import org.lizar.ioc.Container;

public class KanFangEmailNotify implements Cell{

	private MailBox	mailbox;
	
	@Override
	public void init_property() throws Exception {
		mailbox=Container.get(MailBox.class);
	}
	
	public void sendKanFangNotify(long wxproject_id,String customer_name,String customer_contact,String kanfang_date,String project_title,String emailAddress,String visitUrl,EventLoader el) throws AddressException{
		el.setAttr("title", "新客户-看房通知");
		el.setAttr("customer_name", customer_name);
		el.setAttr("customer_contact", customer_contact);
		el.setAttr("kanfang_date", kanfang_date);
		el.setAttr("project_title", project_title);
		el.setAttr("visit_url", visitUrl);
		Email email=new Email(wxproject_id,"新客户-看房通知-["+project_title+","+customer_name+","+customer_contact+"]","爱有微信系统",el.getRealPath("/WEB-INF/email_template/kanfang_notify_template.vm"),emailAddress,el);
		mailbox.sendMail(email);
	}
	
}
